CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(kingflower)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/comm)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/comm/mysql/include/mysql)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/comm/eastl_lib/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/server/jsoncpp/include)

LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/comm/mysql/lib)
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/comm/eastl_lib/src)

SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

ADD_DEFINITIONS(-g -O0  -w -D_REENTRANT -DRELEASE -DIPLIB -DENCRYPT -fno-strict-aliasing)

FILE(GLOB SRC_LIST
  "./*.cpp"
  "./comm/*.cpp"
  "../comm/log/*.cpp"
  "./ip_database/*.cpp"
  "./res/*.cpp"
  "./server/*.cpp"
  "./server/jsoncpp/src/json/*.cpp"
  "./log/*.cpp"
  )


ADD_EXECUTABLE  (kingflower ${SRC_LIST})
  
TARGET_LINK_LIBRARIES(kingflower mysqlclient)
TARGET_LINK_LIBRARIES(kingflower pthread)
TARGET_LINK_LIBRARIES(kingflower dl)
TARGET_LINK_LIBRARIES(kingflower eastl)
TARGET_LINK_LIBRARIES(kingflower z)
TARGET_LINK_LIBRARIES(kingflower iconv)
